import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/supplier',
    name: 'supplier',
    meta,
    redirect: { name: 'supplier' },
    component: layoutHeaderAside,
    children: (pre => [
        {
            path: 'index',
            name: `${pre}index`,
            component: _import('supplier/index'),
            meta: {
                ...meta,
                title: '供应商列表'
            }
        },{
            path: 'supplierProductList',
            name: `${pre}supplierProductList`,
            component: _import('supplier/supplierProductList'),
            meta: {
                ...meta,
                title: '供应商-商品列表'
              }
          }
    ])('supplier-')
}
